using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace NPC.Enemy
{
    [CreateAssetMenu(menuName = "Data/State/Boss/BossHTN", fileName = "BossHTN")]
    public class BOSSState_HTN : BOSSState
    {
        public override void Enter()
        {
            base.Enter();
        }

        public override void Exit()
        {
            base.Exit();
        }

        public override void LogicUpdate()
        {
            base.LogicUpdate();
            
            // 受伤
            if(BossManager.Instance.IsHurting)
                stateMachine.SwitchState(stateMachine.stateTable[typeof(BOSSState_Hurt)]);
            
            // 死亡
            if(BossManager.Instance.IsDeath)
                stateMachine.SwitchState(stateMachine.stateTable[typeof(BOSSState_Death)]);
        }

        public override void PhysicalUpdate()
        {
            base.PhysicalUpdate();
            // 运行 HTN 树
            agent.SetUpdate();
        }
    }
}
